package com.myspace.service.impl.post;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.myspace.mapper.PostMapper;
import com.myspace.pojo.Post;
import com.myspace.service.space.post.GetPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class GetPostServiceImpl implements GetPostService {

    @Autowired
    private PostMapper postMapper;
    @Override
    public List<Post> getpost(Integer user_id) {
        QueryWrapper<Post> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", user_id);
        List<Post> posts = postMapper.selectList(queryWrapper);

        return posts;
    }
}
